package com.csu.cphone.enums;

public enum ServiceType
{

    DOOR_TO_DOOR_SERVICE("上门服务", 1), STORE_SERVICE("门店服务", 2), POST_SERVICE("邮寄服务", 3);

    private String text;
    private Integer value;

    private ServiceType(String text, Integer value)
    {
        this.text = text;
        this.value = value;
    }

    public String getText()
    {
        return text;
    }

    public Integer getValue()
    {
        return value;
    }

    public static ServiceType getByValue(Integer value)
    {
        for (ServiceType serviceType : values())
        {
            if (serviceType.getValue().equals(value))
            {
                return serviceType;
            }
        }
        return null;
    }
}
